import SDKManager from "../SDKManager";

const { ccclass, property } = cc._decorator;

@ccclass
export default class BannerAdComp extends cc.Component {


    @property
    adSite: number = 0;

    // LIFE-CYCLE CALLBACKS:

    onLoad() {
        let falg = SDKManager.getChannel().hasBanner()
        if (falg) {
            // if (SDKManager.getChannel().isBannerOpen())
            SDKManager.getChannel().showBanner(this.adSite)
        }

    }



    onDestroy() {
        cc.log('BannerAdComp onDestroy ', SDKManager.getChannel().hasBanner())
        if (SDKManager.getChannel().hasBanner()) {
            // if (SDKManager.getChannel().isBannerOpen())
            SDKManager.getChannel().hideBanner()
        }
    }
}
